import request from '@/utils/request'

//app 医生详情
export const doctorDetail = (params: any) => {
  return request({
    url: '/app-api/member/doctor/detail',
    method: 'GET',
    body: params,
    hideLoading: false,
  })
}
//修改业务状态
export const editBizStatus = (params: any) => {
  return request({
    url: '/app-api/member/doctor/editBizStatus',
    method: 'PUT',
    body: params,
    hideLoading: false,
  })
}

//修改业务状态
export const myPatient = (params: any) => {
  return request({
    url: '/app-api/consultation/order/myPatient',
    method: 'GET',
    body: params,
    hideLoading: false,
  })
}
//app 问诊订单搜索分页
export const orderPage = (params: any) => {
  return request({
    url: '/app-api/consultation/order/page',
    method: 'POST',
    body: params,
    hideLoading: false,
  })
}
//后台 问诊订单搜索分页
export const orderAdminPage = (params: any) => {
  return request({
    url: '/admin-api/admin/consultation/order/page',
    method: 'POST',
    body: params,
    hideLoading: false,
  })
}
//app 问诊订单详情
export const orderDetail = (params: any) => {
  return request({
    url: '/app-api/consultation/order/detail',
    method: 'GET',
    body: params,
    hideLoading: false,
  })
}

//完成服务
export const orderEnd = (params: any) => {
  return request({
    url: '/app-api/consultation/order/complete',
    method: 'GET',
    body: params,
    hideLoading: false,
  })
}

//app 问诊订单详情
export const orderComment = (params: any) => {
  return request({
    url: '/app-api/consultation/comment/detail',
    method: 'GET',
    body: params,
    hideLoading: false,
  })
}


//获得消息分页
export const messageList = (params: any) => {
    return request({
        url: '/app-api/system/notify-message/page',
        method: 'POST',
        body: params,
        hideLoading: false,
    });
};

//用户端获取未读消息数量
export const messageCountUnread = (params: any) => {
    return request({
        url: '/app-api/system/notify-message/doctor/count-unread',
        method: 'GET',
        body: params,
        hideLoading: false,
    });
};

//用户端更新所有未读消息为已读
export const messageAllRead = (params: any) => {
    return request({
        url: '/app-api/system/notify-message/doctor/all-read',
        method: 'GET',
        body: params,
        hideLoading: false,
    });
};

//获得内容
export const agreement = (params: any) => {
    return request({
        url: '/app-api/system/platform/get/type',
        method: 'GET',
        body: params,
        hideLoading: false,
    });
};
//医生入驻
export const doctorCreate = (params: any) => {
    return request({
        url: '/app-api/member/doctor/enter',
        method: 'POST',
        body: params,
        hideLoading: false,
    });
};

//字典
export const dictDataType = (params: any) => {
    return request({
        url: '/app-api/system/dict-data/type',
        method: 'GET',
        body: params,
        hideLoading: false,
    });
};

//app 用户提现搜索分页
export const crashPage = (params: any) => {
    return request({
        url: '/app-api/doctor/crash/page',
        method: 'POST',
        body: params,
        hideLoading: false,
    });
};

//获得钱包流水分页
export const transactionPage = (params: any) => {
    return request({
        url: '/app-api/pay/wallet-transaction/page',
        method: 'GET',
        body: params,
        hideLoading: false,
    });
};


//获取医生钱包
export const walletGet = (params: any) => {
    return request({
        url: '/app-api/pay/wallet/doctor/get',
        method: 'GET',
        body: params,
        hideLoading: false,
    });
};
//获取宠物详情
export const petGet = (params: any) => {
    return request({
        url: `/app-api/system/pets/mypet/profile/${params.id}`,
        method: 'GET',
        hideLoading: false,
    });
};

//获取医生钱包
export const walletCash = (params: any) => {
    return request({
        url: '/app-api/doctor/crash/create',
        method: 'POST',
        body: params,
        hideLoading: false,
    });
};

//获取医生钱包
export const accountLogin = (params: any) => {
    return request({
        url: '/app-api/member/doctor/auth/login',
        method: 'POST',
        body: params,
        hideLoading: false,
    });
};

//绑定支付方式
export const bindPayWay = (params: any) => {
    return request({
        url: '/app-api/member/doctor/bindPayWay',
        method: 'POST',
        body: params,
        hideLoading: false,
    });
};

//绑定支付方式
export const unBindPayWay = (params: any) => {
    return request({
        url: '/app-api/member/doctor/unbindPayWay',
        method: 'POST',
        body: params,
        hideLoading: false,
    });
};
//编辑医生信息
export const doctoredit = (params: any) => {
    return request({
        url: '/app-api/member/doctor/edit',
        method: 'PUT',
        body: params,
        hideLoading: false,
    });
};
//社交绑定
export const socialUser = (data : any) => {
	return request({
		url: '/app-api/member/doctor/auth/getOpenId',
		method: 'POST',
		body: data,
		hideLoading: false,
	});
};

//实名认证
export const realNameAuth = (data : any) => {
	return request({
		url: '/app-api/member/doctor/realNameAuth',
		method: 'PUT',
		body: data,
		hideLoading: false,
	});
};

///app-api/member/user/update-password
export const updatepassword = (data : any) => {
	return request({
		url: '/app-api/member/doctor/auth/update-password',
		method: 'PUT',
		body: data,
		hideLoading: false,
	});
};

export const faceRecognition = (data : any) => {
	return request({
		url: '/app-api/member/doctor/faceRecognition',
		method: 'POST',
		body: data.url,
		hideLoading: false,
	});
};

export const  formatTimestamp=(timestamp:number)=>{
    // 创建一个新的Date对象并传入时间戳作为参数
    const date = new Date(timestamp);
    
    // 获取年、月、日等信息
    const year = date.getFullYear();
    const month = (date.getMonth() + 1).toString().padStart(2, '0');
    const day = date.getDate().toString().padStart(2, '0');
    const hours = date.getHours().toString().padStart(2, '0');
    const minutes = date.getMinutes().toString().padStart(2, '0');
    const seconds = date.getSeconds().toString().padStart(2, '0');
  
    // 返回格式化后的日期字符串
    return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  }

// 绑定虚拟号
export const get_phone = (data : any) => {
	return request({
		url: '/app-api/consultation/order/privacyBindAxb',
		method: 'POST',
		body: data,
		hideLoading: false,
	});
};
